﻿@inject IStringLocalizer<DialogBodyContext> Localizer

<Button @onclick="@OnClickParameter">@Localizer["BodyContextOpenDialogButton"]</Button>

@code {
    [Inject]
    [NotNull]
    private DialogService? DialogService { get; set; }

    private Task OnClickParameter() => DialogService.Show(new DialogOption()
    {
        Title = "Built-in Counter component",
        BodyContext = "I'm a passer",
        BodyTemplate = builder =>
        {
            var index = 0;
            builder.OpenComponent<DemoComponent>(index++);
            builder.CloseComponent();
        }
    });
}
